﻿using ZhiKeDuoServer.Model;
using IDAL;

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class OperInfoService : Base<OperInfo>, IBase<OperInfo>
    {


 

        public bool Delete(string Code)
        {
            return DB.Client.Deleteable<ZhiKeDuoServer.Model.OperInfo>().Where(t=>t.Code==Code).ExecuteCommand() > 0;
        }


        public new bool DeleteList(string Codelist)
        {
            var list= Codelist.Split(',');
            return DB.Client.Deleteable<ZhiKeDuoServer.Model.OperInfo>().Where(t => list.Contains(t.Code)).ExecuteCommand() > 0;
        }

        public bool Exists(string Code)
        {
             return  DB.Client.Queryable<ZhiKeDuoServer.Model.OperInfo>().Where(t=>t.Code==Code).Any();
            
        }


    

        public ZhiKeDuoServer.Model.OperInfo GetModel(string Code)
        {
             return DB.Client.Queryable<ZhiKeDuoServer.Model.OperInfo>().Where(t => t.Code == Code).First();
        }


    }
}
